﻿// Version:1
// Author:Sanket Naik
// Date:July-21-2010 
// Comments:
// 
// 
// 


using System;
using System.Runtime.Serialization;
using System.Data.Linq.Mapping;
using ManagedServices.Common.DataTransferObject;
using System.ComponentModel;


namespace ManagedServices.DataTransferObjects
{
    /// <summary>
    /// The table representing the Activity log of the msf
    /// </summary>
    [DataContract]
    [global::System.Data.Linq.Mapping.TableAttribute(Name = "dbo.Msf_Tbl_EventLog")]
    public partial class EventLog : INotifyPropertyChanging, INotifyPropertyChanged, ICommonDto
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _Msf_Col_EventID;

        private System.Nullable<System.Guid> _Msf_Col_SubServiceID;

        private System.Nullable<System.Guid> _Msf_Col_SubServiceInstanceID;

        private string _Msf_Col_EventType;

        private string _Msf_Col_EventMessage;

        private string _Msf_Col_EventDetails;

        private System.Guid _Msf_Col_CreatedBy;

        private System.Nullable<System.Guid> _Msf_Col_ModifiedBy;

        private System.DateTime _Msf_Col_CreatedOn;

        private System.Nullable<System.DateTime> _Msf_Col_ModifiedOn;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnEventIDChanging(System.Guid value);
        partial void OnEventIDChanged();
        partial void OnSubServiceIDChanging(System.Nullable<System.Guid> value);
        partial void OnSubServiceIDChanged();
        partial void OnSubServiceInstanceIDChanging(System.Nullable<System.Guid> value);
        partial void OnSubServiceInstanceIDChanged();
        partial void OnEventTypeChanging(string value);
        partial void OnEventTypeChanged();
        partial void OnEventMessageChanging(string value);
        partial void OnEventMessageChanged();
        partial void OnEventDetailsChanging(string value);
        partial void OnEventDetailsChanged();
        partial void OnCreatedByChanging(System.Guid value);
        partial void OnCreatedByChanged();
        partial void OnModifiedByChanging(System.Nullable<System.Guid> value);
        partial void OnModifiedByChanged();
        partial void OnCreatedOnChanging(System.DateTime value);
        partial void OnCreatedOnChanged();
        partial void OnModifiedOnChanging(System.Nullable<System.DateTime> value);
        partial void OnModifiedOnChanged();
        #endregion

        /// <summary>
        /// Default CTor
        /// </summary>
        public EventLog()
        {
            OnCreated();
        }

        /// <summary>
        /// The Unique ID for each event
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name = "Msf_Col_EventID", Storage = "_Msf_Col_EventID", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid EventID
        {
            get
            {
                return this._Msf_Col_EventID;
            }
            set
            {
                if ((this._Msf_Col_EventID != value))
                {
                    this.OnEventIDChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_EventID = value;
                    this.SendPropertyChanged("EventID");
                    this.OnEventIDChanged();
                }
            }
        }

        /// <summary>
        /// The Unique Identifier for a SubService 
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name="Msf_Col_SubServiceID", Storage = "_Msf_Col_SubServiceID", DbType = "UniqueIdentifier")]
        public System.Nullable<System.Guid> SubServiceID
        {
            get
            {
                return this._Msf_Col_SubServiceID;
            }
            set
            {
                if ((this._Msf_Col_SubServiceID != value))
                {
                    this.OnSubServiceIDChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_SubServiceID = value;
                    this.SendPropertyChanged("SubServiceID");
                    this.OnSubServiceIDChanged();
                }
            }
        }

        /// <summary>
        /// The Unique Identifier for a SubService Instance
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name = "Msf_Col_SubServiceInstanceID", Storage = "_Msf_Col_SubServiceInstanceID", DbType = "UniqueIdentifier")]
        public System.Nullable<System.Guid> SubServiceInstanceID
        {
            get
            {
                return this._Msf_Col_SubServiceInstanceID;
            }
            set
            {
                if ((this._Msf_Col_SubServiceInstanceID != value))
                {
                    this.OnSubServiceInstanceIDChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_SubServiceInstanceID = value;
                    this.SendPropertyChanged("SubServiceInstanceID");
                    this.OnSubServiceInstanceIDChanged();
                }
            }
        }

        /// <summary>
        /// The Event Type
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name = "Msf_Col_EventType", Storage = "_Msf_Col_EventType", DbType = "NVarChar(250) NOT NULL", CanBeNull = false)]
        public string EventType
        {
            get
            {
                return this._Msf_Col_EventType;
            }
            set
            {
                if ((this._Msf_Col_EventType != value))
                {
                    this.OnEventTypeChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_EventType = value;
                    this.SendPropertyChanged("EventType");
                    this.OnEventTypeChanged();
                }
            }
        }

        /// <summary>
        /// The Event Message
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name="Msf_Col_EventMessage", Storage = "_Msf_Col_EventMessage", DbType = "NVarChar(250) NOT NULL", CanBeNull = false)]
        public string EventMessage
        {
            get
            {
                return this._Msf_Col_EventMessage;
            }
            set
            {
                if ((this._Msf_Col_EventMessage != value))
                {
                    this.OnEventMessageChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_EventMessage = value;
                    this.SendPropertyChanged("EventMessage");
                    this.OnEventMessageChanged();
                }
            }
        }

        /// <summary>
        /// Primary key for the DTO
        /// </summary>
        public Guid KeyId { get { return EventID; } set { EventID = value; } }

        /// <summary>
        /// The Event Details
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name="Msf_Col_EventDetails", Storage = "_Msf_Col_EventDetails", DbType = "NVarChar(1000)")]
        public string EventDetails
        {
            get
            {
                return this._Msf_Col_EventDetails;
            }
            set
            {
                if ((this._Msf_Col_EventDetails != value))
                {
                    this.OnEventDetailsChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_EventDetails = value;
                    this.SendPropertyChanged("EventDetails");
                    this.OnEventDetailsChanged();
                }
            }
        }

        /// <summary>
        /// Created By
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name="Msf_Col_CreatedBy", Storage = "_Msf_Col_CreatedBy", DbType = "UniqueIdentifier NOT NULL")]
        public System.Guid CreatedBy
        {
            get
            {
                return this._Msf_Col_CreatedBy;
            }
            set
            {
                if ((this._Msf_Col_CreatedBy != value))
                {
                    this.OnCreatedByChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_CreatedBy = value;
                    this.SendPropertyChanged("CreatedBy");
                    this.OnCreatedByChanged();
                }
            }
        }

        /// <summary>
        /// Modified By
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name="Msf_Col_ModifiedBy", Storage = "_Msf_Col_ModifiedBy", DbType = "UniqueIdentifier")]
        public System.Nullable<System.Guid> ModifiedBy
        {
            get
            {
                return this._Msf_Col_ModifiedBy;
            }
            set
            {
                if ((this._Msf_Col_ModifiedBy != value))
                {
                    this.OnModifiedByChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_ModifiedBy = value;
                    this.SendPropertyChanged("ModifiedBy");
                    this.OnModifiedByChanged();
                }
            }
        }

        /// <summary>
        /// Created On
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name = "Msf_Col_CreatedOn", Storage = "_Msf_Col_CreatedOn", DbType = "DateTime NOT NULL")]
        public System.DateTime CreatedOn
        {
            get
            {
                return this._Msf_Col_CreatedOn;
            }
            set
            {
                if ((this._Msf_Col_CreatedOn != value))
                {
                    this.OnCreatedOnChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_CreatedOn = value;
                    this.SendPropertyChanged("CreatedOn");
                    this.OnCreatedOnChanged();
                }
            }
        }

        /// <summary>
        /// Modified On
        /// </summary>
        [DataMember]
        [global::System.Data.Linq.Mapping.ColumnAttribute(Name = "Msf_Col_ModifiedOn", Storage = "_Msf_Col_ModifiedOn", DbType = "DateTime")]
        public System.Nullable<System.DateTime> ModifiedOn
        {
            get
            {
                return this._Msf_Col_ModifiedOn;
            }
            set
            {
                if ((this._Msf_Col_ModifiedOn != value))
                {
                    this.OnModifiedOnChanging(value);
                    this.SendPropertyChanging();
                    this._Msf_Col_ModifiedOn = value;
                    this.SendPropertyChanged("ModifiedOn");
                    this.OnModifiedOnChanged();
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

}
